package com.hf.eagle.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.hf.eagle.dao.OrderDealInfoDao;
import com.hf.eagle.dao.OrderInfoDao;
import com.hf.eagle.domain.OrderDealInfo;
import com.hf.eagle.domain.OrderInfo;
import com.hf.eagle.service.OrderDealInfoService;

/**
 * @author Xu,XiaoYuan
 * @version 2011-11-16 23:23
 */
@Service
public class OrderDealInfoServiceImpl implements OrderDealInfoService {

	@Resource
	private OrderDealInfoDao orderDealInfoDao;

	@Resource
	private OrderInfoDao orderInfoDao;

	public Long createOrderDealInfo(OrderDealInfo t) {
		Long orde_id = t.getOrder_id();
		OrderInfo orderInfo = new OrderInfo();
		orderInfo.setId(orde_id);
		orderInfo.setState(t.getDeal_mode());
		orderInfoDao.updateEntity(orderInfo);

		return this.orderDealInfoDao.insertEntity(t);
	}

	public OrderDealInfo getOrderDealInfo(OrderDealInfo t) {
		return this.orderDealInfoDao.selectEntity(t);
	}

	public Long getOrderDealInfoCount(OrderDealInfo t) {
		return this.orderDealInfoDao.selectEntityCount(t);
	}

	public List<OrderDealInfo> getOrderDealInfoList(OrderDealInfo t) {
		return this.orderDealInfoDao.selectEntityList(t);
	}

	public int modifyOrderDealInfo(OrderDealInfo t) {
		return this.orderDealInfoDao.updateEntity(t);
	}

	public int removeOrderDealInfo(OrderDealInfo t) {
		return this.orderDealInfoDao.deleteEntity(t);
	}

	public List<OrderDealInfo> getOrderDealInfoPaginatedList(OrderDealInfo t) {
		return this.orderDealInfoDao.selectEntityPaginatedList(t);
	}

}
